package com.linuxgt.pattern.command.scheme3;

import java.util.ArrayList;

/**
 * Created by LIUTENG on 2015-01-09.
 */
public class MacroCommand implements Command {
    ArrayList<Command> commandList;

    public MacroCommand(ArrayList<Command> commandList) {
        this.commandList = commandList;
    }

    @Override
    public void execute() {
        for (int k = 0; k < commandList.size(); k++) {
            Command command = commandList.get(k);
            command.execute();
        }
    }
}
